package com;

public class GenericsDemo2 {
    public static void main(String[] args) {
        GenericsImpl<String> g = new GenericsImpl<>();
        g.method("宝，我今天偷了自行车给你");

        GenericsImp2 g2 = new GenericsImp2();
        g2.method(12);
    }
}
interface Generics<T> {
    void method(T t);
}
class GenericsImp2 implements Generics<Integer> {
    @Override
    public void method(Integer integer) {
        System.out.println(integer);
    }
}
class GenericsImpl<T> implements Generics<T> {
    @Override
    public void method(T t) {
        System.out.println(t);
    }
}
